﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //User authenticed
        if (Membership.GetUser() == null)
        {
            CustomWelcomeContent.Text = "Please create an account";
            createAcc.Visible = false;
            
        }
        else
        {
            ManagerUser.setUserName(Membership.GetUser().UserName);
            int numOfAccount = ManagerUser.getAccounts();
            CustomWelcomeContent.Text = "You have " + numOfAccount + " Bank account(s).";
            
            

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/BankAccount/createBankAccount.aspx");
    }
}
